<? if (!$this->mainPage):?>
    <input type="text" name="q" class="search-query" placeholder="Поиск" id="search-terms" value="<?=$this->query ?>">
    <? if ($this->tags):?>
        <script type="text/javascript">
            $(function() {
                study.getCloudTags(<?= Application_Model_StudyMapper::tagsToJsonForCloud($this->tags) ?>);
            });
        </script>
        <h4>Облако тегов:</h4>
        <div id="cloud-tags" style="width: 250px; height: 300px;"></div>
    <? endif; ?>
<? endif; ?>
<table class="table table-striped">
    <? foreach ($this->termsInAction as $term):?>
        <? /** @var $term Application_Model_Term */?>
        <tr id="term-id-<?= $term->getTermId(); ?>">
            <td >
                <a href="/study?q=<?=$term->getTermName()?>" onclick="study.editTerm(<?=$term->getTermId()?>)"><?=$term->getTermName() ?></a>

                <div class="post-action">
                    <? if (!$this->mainPage):?>
                        <i title="Убрать из текущих" class="icon-check" onclick="study.setAction(<?=$term->getTermId()?>, 0)"></i>
                        <i title="Удалить" class="icon-trash" onclick="study.deleteTerm(<?=$term->getTermId()?>);"></i>
                    <? else:?>
                        <i title="В дайджест" class="icon-eye-open" onclick="mn.addThing(<?=$term->getTermId()?>, <?= Application_Model_Thing::TYPE_STUDY ?>, $('#term-id-<?= $term->getTermId(); ?>'));"></i>
                    <? endif;?>
                </div>
            </td>
        </tr>
    <? endforeach; ?>
</table>
